<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8" />
    <script type="module" src="/node_modules/@bugsnag/browser/dist/bugsnag.min.js"></script>
    <script type="module">
      var NOTIFY = decodeURIComponent(window.location.search.match(/NOTIFY=([^&]+)/)[1])
      var SESSIONS = decodeURIComponent(window.location.search.match(/SESSIONS=([^&]+)/)[1])
      var API_KEY = decodeURIComponent(window.location.search.match(/API_KEY=([^&]+)/)[1])
      window.bugsnagClient = window.Bugsnag.start({
        apiKey: API_KEY,
        endpoints: { notify: NOTIFY, sessions: SESSIONS }
      })
    </script>
  </head>
  <body>
    <pre id="bugsnag-test-should-run">PENDING</pre>
    <script nomodule>
      var __lacksModuleSupport = true;
    </script>
    <script>
      var el = document.getElementById('bugsnag-test-should-run')
      el.textContent = el.innerText = typeof __lacksModuleSupport !== 'undefined' ? 'NO' : 'YES'
    </script>
    <script type="module">
      var customError = {
        name: 'Unlikely scenario',
        stack: window.Bugsnag.Event.getStacktrace()
      }
      window.Bugsnag.notify(customError)
    </script>
  </body>
</html>
